package com.exer;

class MyThraed1 extends Thread{
    @Override
    public void run(){
        for (int i = 0;i < 100;i++){
            if (i % 2 == 0){
                System.out.println(Thread.currentThread().getName() + ":" + i);
            }
        }
    }
}

class   MyThread2 extends Thread{
    @Override
    public void run() {
        for (int i = 1; i < 100; i++) {
            if (i % 2 != 0 ){
                System.out.println(Thread.currentThread().getName() + ":" + i);
            }
        }
    }
}

public class ThreadDemo  {
    public static void main(String[] args) {
        MyThraed1 m1 = new MyThraed1();
        m1.start();

        MyThread2 m2 = new MyThread2();
        m2.start();

    }
}

